"""add attempt stats and suggestions

Revision ID: c9cfdcf5dcc4
Revises: f8723257585a
Create Date: 2025-09-26 08:10:08.374847

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = 'c9cfdcf5dcc4'
down_revision: Union[str, None] = 'f8723257585a'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    with op.batch_alter_table('test_attempts') as batch_op:
        batch_op.add_column(sa.Column('correct_count', sa.Integer(), nullable=True))
        batch_op.add_column(sa.Column('total_questions', sa.Integer(), nullable=True))
        batch_op.add_column(sa.Column('suggestions', sa.JSON(), nullable=True))


def downgrade() -> None:
    with op.batch_alter_table('test_attempts') as batch_op:
        batch_op.drop_column('suggestions')
        batch_op.drop_column('total_questions')
        batch_op.drop_column('correct_count')
